<!--
 * @Description:基础table
 * @Version: 2.0
 * @Autor: kafei
 * @Date: 2021-11-29 16:09:33
 * @LastEditors: kafei
 * @LastEditTime: 2021-12-01 11:01:50
-->
<template>
  <div class="baseTable z-w-100">
    <el-table
      :data="tableData"
      border
      height="100%"
      highlight-current-row
    >
      <el-table-column
        v-for="item in columnData"
        :key="item.props"
        :label="item.label"
        v-bind="item.columnConfig"
        align="center"
        :prop="item.props"
        show-overflow-tooltip
      >
        <template slot-scope="{ row, $index }">
          <slot v-if="item.isTemplate">
            <slot
              :name="item.props"
              :data="{ row: row, props: item.props, index: $index }"
            />
          </slot>
          <slot v-else>
            {{ row[item.props] }}
          </slot>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: 'BaseTable',
  props: {
    columnData: {
      type: Array,
      default: () => {
        return []
      }
    },
    tableData: {
      type: Array,
      default: () => {
        return []
      }
    }
  }
}
</script>

<style>

</style>
